﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PPIDesktopClient
{
    public partial class frmOutbox : frmDialogBase
    {
        private string m_ConnectionString;
        public string ConnectionString
        {
            get
            {
                return m_ConnectionString;
            }
            set
            {
                m_ConnectionString = value;
            }
        }

        public frmOutbox()
        {
            InitializeComponent();
        }

        #region Events

        #region Form
        private void frmOutbox_Load(object sender, EventArgs e)
        {
            m_ConnectionString = null;
            ctrlDatabases.LoadDatatoSelect();
            if (!ctrlDatabases.HasDatabase())
            {
                MessageBox.Show("No mobile database available. Copy a mobile database to access mobile database information.");
                this.btnClose_Click(this, new EventArgs());
            }
        }


        #endregion

        #region Controls

        private void btnLoad_Click(object sender, EventArgs e)
        {
            m_ConnectionString = null;
            this.DialogResult = DialogResult.OK;
            m_ConnectionString = ctrlDatabases.SelectedConnectionString;
            this.Close();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            m_ConnectionString = null;
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }


        #endregion

        #endregion


    }
}
